package decorator;/** * Created by Administrator on 2018-10-20. * 摩卡（装饰者，继承调料） */public class Mocha extends CondimentDecorator {    Beverage beverage;//要让摩卡能够引用一个Beverage,用一个实例变量记录饮料，也就是被装饰着    public Mocha(Beverage beverage){//通过构造器把被装饰着（饮料）记录到实例中去        this.beverage = beverage;    }    public String getDescription() {        return beverage.getDescription()+" Mocha";    }    public double cost() {        return .20 + beverage.cost() ;    }}